import { defineStore } from 'pinia';

export const uesUserStore = defineStore('user', {
    persist: {
        key: 'userStore',
        storage: window.sessionStorage
    },
    state: (): { token: string | null } => ({
        token: null
    }),
    actions: {
        setToken(token: string) {
            this.token = token;
            return;
        }
    },
    getters: {
        tokenGetter(state: any) {
            return state.token;
        }
    }
});
